<#include "../inc/header.ftl" />
<#import "/META-INF/spring.ftl" as spring />
<#import "/META-INF/mspring.ftl" as mspring />
<form id="baeForm" name="baeForm" method="post" action="${base}/admin/comment/spam/config/save">
	<div id="error" class="message error" style="display:none;"></div>
	<table class="infotable">
		<tr>
			<td colspan="3" class="partition">新闻配置</td>
		</tr>
		<tr>
			<td colspan="3" style="text-align:center;">
				<input type="button" class="btn" value=" 更新新闻索引 " onclick="updateLuceneIndex();" />
				<input type="button" class="btn" value=" 优化新闻索引 " onclick="optimizeLuceneIndex();" />
			</td>
		</tr>
	</table>
</form>
<script type="text/javascript">
	function updateLuceneIndex(){
		$.get("${base}/admin/news/config/updateindex", function(response){
			if(response.success){
				alert("新闻索引更新成功。");
			}
			else {
				alert(response.message);
			}
		});
	}
	
	function optimizeLuceneIndex(){
		$.get("${base}/admin/news/config/optimizeindex", function(response){
			if(response.success){
				alert("优化新闻索引成功。");
			}
			else {
				alert(response.message);
			}
		});
	}
	
	$(document).ready(function(){
		//斑马线
		var tables=document.getElementsByTagName("table");
		var b=false;
		for (var j = 0; j < tables.length; j++){
			var cells = tables[j].getElementsByTagName("tr");
			//cells[0].className="color3";
			b=false;
			for (var i = 0; i < cells.length; i++){
				if(b){
					cells[i].className="color2";
					b=false;
				}
				else{
					cells[i].className="color3";
					b=true;
				};
			};
		}
	});
</script>
<#include "../inc/footer.ftl" />